package com.itheima.case2.dao;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;

public interface UserRoleMapper {
    //删除中间表数据
    @Delete("delete from t_user_role where user_id=#{id}")
    void deleteByUserId(@Param("id") Integer id);

    //在中间表添加数据
    @Insert("insert into t_user_role values (#{uid},#{rid})")
    void add(@Param("uid") Integer id, @Param("rid") Integer roleId);

}
